package cn.zktr.Personnel.model.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the per_ret_dem database table.
 * 
 */
@Entity
@Table(name="per_ret_dem")
@NamedQuery(name="PerRetDem.findAll", query="SELECT p FROM PerRetDem p")
public class PerRetDem implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int demid;

	private String demqld;

	//bi-directional many-to-one association to PerIntention
	@OneToMany(mappedBy="perRetDem")
	private List<PerIntention> perIntentions;

	//bi-directional many-to-one association to PerRetRse
	@ManyToOne
	@JoinColumn(name="RSEID")
	private PerRetRse perRetRse;

	//bi-directional many-to-one association to PerRetWAlt
	@ManyToOne
	@JoinColumn(name="ALTID")
	private PerRetWAlt perRetWAlt;

	//bi-directional many-to-one association to PerRetWen
	@OneToMany(mappedBy="perRetDem")
	private List<PerRetWen> perRetWens;

	public PerRetDem() {
	}

	public int getDemid() {
		return this.demid;
	}

	public void setDemid(int demid) {
		this.demid = demid;
	}

	public String getDemqld() {
		return this.demqld;
	}

	public void setDemqld(String demqld) {
		this.demqld = demqld;
	}

	public List<PerIntention> getPerIntentions() {
		return this.perIntentions;
	}

	public void setPerIntentions(List<PerIntention> perIntentions) {
		this.perIntentions = perIntentions;
	}

	public PerIntention addPerIntention(PerIntention perIntention) {
		getPerIntentions().add(perIntention);
		perIntention.setPerRetDem(this);

		return perIntention;
	}

	public PerIntention removePerIntention(PerIntention perIntention) {
		getPerIntentions().remove(perIntention);
		perIntention.setPerRetDem(null);

		return perIntention;
	}

	public PerRetRse getPerRetRse() {
		return this.perRetRse;
	}

	public void setPerRetRse(PerRetRse perRetRse) {
		this.perRetRse = perRetRse;
	}

	public PerRetWAlt getPerRetWAlt() {
		return this.perRetWAlt;
	}

	public void setPerRetWAlt(PerRetWAlt perRetWAlt) {
		this.perRetWAlt = perRetWAlt;
	}

	public List<PerRetWen> getPerRetWens() {
		return this.perRetWens;
	}

	public void setPerRetWens(List<PerRetWen> perRetWens) {
		this.perRetWens = perRetWens;
	}

	public PerRetWen addPerRetWen(PerRetWen perRetWen) {
		getPerRetWens().add(perRetWen);
		perRetWen.setPerRetDem(this);

		return perRetWen;
	}

	public PerRetWen removePerRetWen(PerRetWen perRetWen) {
		getPerRetWens().remove(perRetWen);
		perRetWen.setPerRetDem(null);

		return perRetWen;
	}

}